export default function convertNumber(number: any) {
  if (number < 10 ** 3) {
    return number;
  }
  if (10 ** 3 <= number && number < 10 ** 6) {
    return `${(number / 10 ** 3).toFixed(1)} K`;
  }
  if (10 ** 6 <= number && number < 10 ** 9) {
    return `${(number / 10 ** 6).toFixed(1)} M`;
  }
  if (10 ** 9 <= number && number < 10 ** 12) {
    return `${(number / 10 ** 9).toFixed(1)} G`;
  }
  return `${(number / 10 ** 12).toFixed(1)} T`;
}

export function convertBase(number: any) {
  if (number < 10 ** 3) {
    return number;
  }
  if (10 ** 3 <= number && number < 10 ** 6) {
    return `${(number / 10 ** 3).toFixed(1)} Kb`;
  }
  if (10 ** 6 <= number && number < 10 ** 9) {
    return `${(number / 10 ** 6).toFixed(1)} Mb`;
  }
  if (10 ** 9 <= number && number < 10 ** 12) {
    return `${(number / 10 ** 9).toFixed(1)} Gb`;
  }
  return `${(number / 10 ** 12).toFixed(1)} Tb`;
}
